package com.hfzy.ihk.facade.linkcall.enums.KnowledgeBase;

import com.hfzy.ihk.common.facade.elasticsearch.entity.ElasticsearchTable;
import com.hfzy.ihk.facade.linkcall.entity.knowledge.KnowledgeBase;
import com.hfzy.ihk.facade.linkcall.entity.knowledge.QuestionBase;

import java.util.HashMap;
import java.util.Map;

/**
 * @Auther: ouyicong
 * @Date: 2018/8/14 01:04
 * @Description:
 */
public enum QuestionBaseTables implements ElasticsearchTable{
    QUESTIONBASE(QuestionBase.class.getName(),"操作学习分析的表"),
    KNOWLEDGEBASE(KnowledgeBase.class.getName(),"操作知识库的表");

    private String value;

    private String desc;

    private static Map<String, QuestionBaseTables> map = new HashMap<>();

    static {



        for (QuestionBaseTables value:QuestionBaseTables.values()){

            map.put(value.getValue(),value);

        }

    }
    ;

    public  static QuestionBaseTables fromValue(String value){

        QuestionBaseTables table=map.get(value);

        if(table!=null){

            return table;
        }else {

            throw new IllegalArgumentException("No enum const " + QuestionBaseTables.class + "." + value);
        }

    };


    @Override
    public String getTableName() {
        return getValue();
    }

    QuestionBaseTables(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
